package com.turboconnard.display;

import android.graphics.drawable.Drawable;

import com.turboconnard.data.Library;
import com.turboconnard.tools.Textures;

public class Bitmap extends Sprite{
	public static String TL = "topLeft";
	public static String TR = "topRight";
	public static String TC = "topMiddle";
	
	public static String BR = "bottomeRight";
	public static String BL = "bottomeLeft";
	public static String BC = "bottomCenter";
	
	public static String CR = "centerRight";
	public static String CL = "centerLeft";
	public static String CC = "centerCenter";
	
	public String align = CC;
	
	private int h;
	private int w;
	public int width = w;
	public int height = h;
	private Plane _plane;
	
	public Bitmap(int d){
		super();
		Drawable _img = Library.getInstance().resources.getDrawable(d);
		height = h = _img.getIntrinsicHeight();
		width = w = _img.getIntrinsicWidth();
		
		_plane = new Plane(width,height);		
		_plane.texture = d;
		addChild(_plane);
	}
	public Bitmap(int d,int align){
		super();
		Drawable _img = Library.getInstance().resources.getDrawable(d);
		height = h = _img.getIntrinsicHeight();
		width = w = _img.getIntrinsicWidth();
		
		_plane = new Plane(width,height,align);		
		_plane.texture = d;
		addChild(_plane);
	}
	@Override
	public void _update(){
				
	}
	
	/*@Override
	public void _draw(GL10 gl){
		
		if(align == CC) _img.setBounds((int) x -w/2, (int) y -h/2,(int) x+w/2,(int) y+h/2);
		else if(align == TL)_img.setBounds((int) x, (int) y,(int) x+w ,(int) y+h);
		else if(align == TR)_img.setBounds((int) x-w, (int) y,(int) x ,(int) y+h);
		else if(align == TC)_img.setBounds((int) x-w/2, (int) y,(int) x+w/2 ,(int) y+h);
		else if(align == BL)_img.setBounds((int) x, (int) y-h,(int) x+w ,(int) y);
		else if(align == BR)_img.setBounds((int) x-w, (int) y-h,(int) x ,(int) y);
		else if(align == BC)_img.setBounds((int) x-w/2, (int) y-h,(int) x+w/2 ,(int) y);
		else if(align == CR)_img.setBounds((int) x-w, (int) y-h/2,(int) x ,(int) y+h/2);
		else if(align == CL)_img.setBounds((int) x, (int) y-h/2,(int) x+w,(int) y+h/2);
		
		//_img.draw(gl);
	}
*/
}
